package in.muton.edushare.pages.user.panels;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.PropertyModel;

import com.edushare.common.constants.ApplicationConstants;

import in.muton.edushare.pages.EduShareBasePage;
import in.muton.edushare.pages.common.EdusharePanel;
import in.muton.edushare.pages.univ.UnivBase;
import in.muton.edushare.pages.user.UserBase;
import in.muton.edushare.panels.images.ImageWithLink;
import in.muton.edushare.summary.html.UnivSummary;
import in.muton.edushare.summary.html.UserSummary;

public class MyBannerPanel extends EdusharePanel {

	public MyBannerPanel(String id, final UserBase page) {
		super(id, page);
		add(new ImageWithLink("profImage", page.getModel(), ApplicationConstants.FILE_SUFFIX_ICON));
		add(new Label("owner", new PropertyModel<String>(page,"model.object.completeUserName")));
		PageParameters pp = new PageParameters();
		pp.add("0", page.getModel().getObject().getUserName());
		add(new BookmarkablePageLink<Void>("profileLink", in.muton.edushare.pages.publicpages.userpages.UserProfile.class,pp));
		add(new Link<Void>("printReport"){
			@Override
			public void onClick() {
				setResponsePage(new UserSummary(page.getModel()));
			}});
	}

}
